package com.yan.test.work.testadapter

import android.os.Bundle
import android.view.LayoutInflater
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.yan.test.work.testadapter.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {

    val mbinding by lazy {
        ActivityMainBinding.inflate(LayoutInflater.from(this))
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(mbinding.root)

        initView()
    }

    private fun initView() {
        val manager = GridLayoutManager(this, 3 , LinearLayoutManager.VERTICAL , false)
        mbinding.listView.layoutManager = manager
        mbinding.listView.adapter = MainAdapter(manager)

    }
}